import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws IOException {
        FileInputStream in = new FileInputStream("D:\\a\\a.txt");
        FileOutputStream out = new FileOutputStream("D:\\a\\b.txt");
        byte[] bys = new byte[1024];
        int len;
        while ((len = in.read(bys)) != -1) {
            out.write(bys, 0, len);
        }
        in.close();
        out.close();
    }
}
